package com.linwen.excise.niuke._20;

import java.util.*;

/**
 * @author wlw
 * @date 2023/3/3 10:49 PM
 */
public class _19简单错误记录 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        List<String> list = new ArrayList<>();
        while (scanner.hasNextLine()){
            String str = scanner.nextLine();
            if(str.length()==0){
                break;
            }
            list.add(str);
        }
        Map<String,Integer> map = new HashMap<>();
        Queue<String> queue = new LinkedList<>();
        for (String s : list) {
            String[] sTemp = s.split(" ");
            int i = sTemp[0].lastIndexOf("\\");;
            String fileName = sTemp[0].substring(i+1,sTemp[0].length());
            fileName = fileName.substring(Math.max(fileName.length()-16,0),fileName.length());
            String str = fileName+" "+sTemp[1];
            if(map.containsKey(str)){
                map.put(str,map.get(str)+1);
            }else{
                map.put(str,1);
                queue.add(str);
            }
        }
        while (queue.size()>8){
            queue.poll();
        }
        for (String s : queue) {
            System.out.println(s+" "+map.get(s));
        }

    }
}
